<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    全选：<input type="checkbox" v-model="checked" @change="allfn">
    <div>
      <input type="checkbox" v-model="list" value="html" id="">html
      <input type="checkbox" v-model="list" value="css" id="">css
      <input type="checkbox" v-model="list" value="js" id="">js
    </div>
  </div>
  <script src="/vue.js"></script>
  <script>
    const app = new Vue({
      el:"#app",
      data:{
        checked: true,
      list:['html']
      },
      methods: {
        allfn() {
          if (this.checked) {
            // 全选
            this.list = ['html', 'css', 'js']
          } else {
            this.list = []
          }
        }
      }
    })
  </script>
</body>
</html>